Developer --> Technical Publications
PATHMac OS 8 Developer Documentation > Files > Folder Manager >

Folder Manager Reference


Routing Files

With Mac OS 8.5 and later, your application can also use the Folder Manager to specify folder routings. Folder routings determine the folder to which the Finder routes a file of a given type.

The Folder Manager provides the following functions for routing files:


AddFolderRouting

Adds a folder routing structure to the global routing list.

pascal OSErr AddFolderRouting (
                     OSType fileType,
                     FolderType routeFromFolder,
                     FolderType routeToFolder,
                     RoutingFlags flags,
                     Boolean replaceFlag);
fileType
Pass the OSType of the file to be routed.
routeFromFolder
Pass the folder type of the "from" folder; see Folder Type Constants for descriptions of possible values. An item dropped on the folder specified in this parameter will be routed to the folder specified in the routeToFolder parameter.
routeToFolder The folder type of the "to" folder; see Folder Type Constants
for descriptions of possible values.
flags
Reserved for future use; pass 0.
replaceFlag
Pass a Boolean value indicating whether you wish to replace a folder routing that already exists. If true , it replaces the folder to which the item is being routed. If false , it leaves the folder to which the item is being routed.
function result
A result code; see Folder Manager Result Codes . The result code duplicateRoutingErr indicates that a folder routing is already installed with the specified folder type and replaceFlag is false.

DISCUSSION

Your application can use the AddFolderRouting function to specify how the Finder routes a given file type.


VERSION NOTES

Supported under Mac OS 8.5 and later.


FindFolderRouting

Finds the destination folder from a matching folder routing structure for the specified file.

pascal OSErr FindFolderRouting (
                     OSType fileType,
                     FolderType routeFromFolder,
                     FolderType *routeToFolder,
                     RoutingFlags *flags);
fileType
Pass the file type specified in the appropriate folder routing structure for the file for which you wish to find a destination folder.
routeFromFolder
Pass the folder type of the "from" folder for which you wish to find a "to" folder; see Folder Type Constants for descriptions of possible values. An item dropped on the folder specified in this parameter will be routed to the folder specified in the routeToFolder parameter.
routeToFolder
A pointer to a value of type FolderType . On return, the value is set to the folder type of the destination folder. See Folder Type Constants for descriptions of possible values
flags
Reserved; pass 0.
function result
A result code; see Folder Manager Result Codes .

DISCUSSION

Both the file type and the folder type specified must match those of a folder routing structure in the global routing list for the FindFolderRouting function to succeed.


SPECIAL CONSIDERATIONS

The system initializes the Folder Manager's routing tables with a resource of type 'nrt#' located in the System file. You should not modify or rely on the contents of the 'nrt#' resource in the System file; use only the FindFolderRouting function to find the appropriate folder routing information.


VERSION NOTES

Supported under Mac OS 8 and later.


GetFolderRoutings

Obtains folder routing information from the global routing list.

pascal OSErr GetFolderRoutings (
                     UInt32 requestedRoutingCount,
                     UInt32 *totalRoutingCount,
                     Size routingSize,
                     FolderRouting *theRoutings);
requestedRoutingCount
An unsigned 32-bit value. Pass the number of folder routing structures that can fit in the buffer pointed to by the theRoutings parameter.
totalRoutingCount
A pointer to an unsigned 32-bit value. On return, the value is set to the number of folder routing structures in the global list. If this value is less than or equal to requestedRoutingCount , all folder routing structures were returned to the caller.
routingSize
Pass the size (in bytes) of the FolderRouting structure.
theRoutings
Pass a pointer to an array of FolderRouting structures. On return the structure(s) contain the requested routing information. You may pass nil if you do not wish this information.
function result
A result code; see Folder Manager Result Codes .

DISCUSSION

The folder routing information in the global routing list determines how the Finder routes files.


VERSION NOTES

Supported under Mac OS 8 and later.


RemoveFolderRouting

Deletes a folder routing structure from the global routing list.

pascal OSErr RemoveFolderRouting (
                     OSType fileType,
                     FolderType routeFromFolder);
fileType
Pass the file type value contained in the folder routing structure to be removed.
routeFromFolder
Pass the folder type of the "from" folder; see Folder Type Constants for descriptions of possible values.
function result
A result code; see Folder Manager Result Codes .

DISCUSSION

Both the file type and the folder type specified must match those of an existing folder routing structure in the global routing list for the RemoveFolderRouting function to succeed.


VERSION NOTES

Supported under Mac OS 8.5 and later.


© 1998 Apple Computer, Inc. - (Last Updated 19 Nov 98)

Previous | Back Up One Level | Next | Show Frames | Hide Frames